package com.firmail.utils;


import com.firmail.exception.type.ExceptionType;
import com.firmail.response.ResponseInfo;

/**
 * 
 * @Description ResponseDataUtils
 *
 * @author asdf
 * @date 2018年1月12日 上午10:59:01
 *
 */
public class ResponseExceptionUtils {

	public static void setException(ResponseInfo<?> info, ExceptionType type) {
		if (info != null) {
			/*int code = 0;
			String message = null;
			switch (type) {
			case SYSTEM_EXCEPTION:
				code = Constants.EC_INTERNAL_ERROR;
				message = Constants.EC_INTERNAL_ERROR_DESC;
				break;
			case PARAMETER_ERROR_EXCEPTION:
				code = Constants.PARAMETER_ERROR;
				message = Constants.PARAMETER_ERROR_DESC;
				break;
			case PARAMETER_INVALID_EXCEPTION:
				code = Constants.PARAMETER_INVALID_ERROR;
				message = Constants.PARAMETER_INVALID_ERROR_DESC;
				break;
			default:
				code = Constants.EC_INTERNAL_ERROR;
				message = Constants.EC_INTERNAL_ERROR_DESC;
				break;
			}
			info.setResultCode(code);
			info.setMessage(message);*/
			info.setCode(type.getCode());
			info.setMessage(type.getMessage());
		}
	}


}
